"use client";
import { Footer } from "@/components/Footer";
import { NavBar } from "@/components/NavBar";
import { usePathname } from "next/navigation";
import { hollowNavBarPaths, noFooterPaths } from "@/config/render";
import { BackToTop } from "@/components/BackToTop";

export default function Layout({ children }: React.PropsWithChildren) {
  //获取当前的路由
  const pathname = usePathname();
  const noFooter = noFooterPaths.includes(pathname);
  return (
    <>
      <NavBar hollow={hollowNavBarPaths.includes(pathname)} />
      <main className="min-h-screen h-fit">{children}</main>
      <div className="h-screen w-screen fixed top-0 left-0 z-[-1] fixed-bg" />
      {!noFooter && <Footer />}
      <BackToTop />
    </>
  );
}
